import App from './App'
import {
	createPinia
} from 'pinia'
import i18n from './common/i18n'
import uviewPlus from '@/uni_modules/uview-plus'

// #ifndef VUE3
// import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})


app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	const pinia = createPinia()
	// 配置全局CDN基础路径
	app.config.globalProperties.$cdn = 'https://gx.jifgou.com/image/'
	// 封装cdn方法挂载到全局
	app.config.globalProperties.cdn = (path) => {
		return app.config.globalProperties.$cdn + path
	}
	app.use(pinia)
	app.use(i18n)
	app.use(uviewPlus)
	// 必须！设置全局变量 $uv

	// 必须先 use pinia

	return {
		app,
		pinia
	}
}
// #endif